1

1

DOI: 10.1201/9781003214335-1

Introduction

The earth rotates around its axis every 23 hours, 56 minutes, and 4 seconds. We call

this a day and then, before we know it, the calendar automatically changes its date to

the next day. A day is never enough to get everything done! If we pause for a moment

and think about the tasks we could not complete, quite often it is because they are

repetitive and high in volume. Repetitive tasks throw a damper to our spirits—​espe­

cially if they are numerous. A task that needs to be done again and again is no longer

interesting, and mentally we are ready to move on to something different, even if it is

simply to relieve the drudgery.

Take for example an analyst who needs to compile a financial report with 600 lines

of amounts in a single currency. Yes, the currency conversion table is available in a

spreadsheet, but the rate changes every day. The analyst needs to do this boring task

of downloading the rate from a website and fitting it into a table, adjusting “vlookups”

and confirming that the amounts are all converted correctly—​manual tasks have

chances of error and the only way to assure their accuracy is through spending even

more time checking them.

Take another example where a survey is launched and the budget inputs for dif­

ferent departments all come in separate forms—​there is no quick way to merge them

into one spreadsheet although the formats are the same.

We have a robot. We can use the robot to do a great deal of the repetitive work. If

only we knew how to train it!

Yes, I am talking about the laptop we own. It has come a long way from the first

computer ENIAC. Invented in 1943, it had 18,000 vacuum tubes and occupied 1,800

square feet of space. The modern-​day laptop takes the speed of ENIAC from about

400 instructions per second to several billion—​that is quite impressive in terms of

speed. But what good is the speed if we cannot use it to solve our daily problems and

reduce the time we spend on our boring tasks? We have our speedy computer but how

do we harness its power? How do we explain to our speedy computer—​the untrained

robot—​the problems we want help with?

This is the theme of the book. How to train your robot by a combination of common

sense, algorithmic skills, and a bit of coding. And have some fun along the way! You

will find immense joy in creating your ideas and helping others with the code you

develop!

This book is not about teaching you the syntax of coding—​for that, there are man­

uals available online that you can refer to. (I have provided some links at the end

of this book.) Unlike a traditional computer programming book, I have covered the

essential programming techniques in simple and fun ways for you to experiment

and learn. The techniques are by no means exhaustive, but sufficient for you to get

inspired, learn coding, and enjoy the process! They are explained in an increasing

order of complexity to help you develop your skill of coding an algorithm in progres­

sive steps.